Repository navigation
fix(bundler-plugins): Keep uploading when a directory has no source maps - #26092
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
The new CLI fails a directory with no JS + source map pairs. The adapter uploads directories one by one, so the first empty one (.next/server for Next.js apps without server source maps) aborted the rest, and client source maps were never uploaded. Pass allowEmpty and warn per directory. Co-Authored-By: Miguel Betegon <miguel.betegon@sentry.io>
Contributor
size-limit report 📦Compared: c6625a2 (PR test merge using develop at 23eca77) Against: d138b7b (develop) · base run #64941
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 3 not successful, 41 successful. See the run.
Successful checks
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: The new
sentryCLI throws aValidationErrorfor any directory that has no JS + source map pairs.SentryCliAdapter.uploadSourcemapsuploads directories one at a time, so the first empty directory stops the whole loop.@sentry/nextjsuploads.next/serverfirst, so if server source maps are off, the client chunks that do have maps never get uploaded. This is the largest share of the CLI's top sourcemap error (CLI-1FN, ~18k events/day, all fromsentry@0.45.0called through this adapter).The CLI check stays strict on purpose, because it catches build misconfiguration. The adapter now passes
allowEmpty: true, collects the directories that uploaded 0 files, and logs a warning for each. In direct-upload mode, "Successfully uploaded" is logged only if at least one directory actually uploaded something.Before:
After:
How to review: Start with
src/core/cli.ts, then the two call sites inbuild-plugin-manager.ts.cli-contract.test.tsruns the real CLI against the mock server with one empty directory followed by one real directory.Unsure about:
package.jsonpins"sentry": "^0.45.0", which on 0.x resolves to<0.46.0. Users won't get the CLI-side fixes (getsentry/toolkit#1606, #1934, #1937) until that range is bumped. I left it alone because this PR shouldn't change dependencies.via bete.
--
View Session [Sentry]